package reader.file;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class FileProcessorPool {

    private static FileProperties fileProperties;

    private static ExecutorService pool;

    public static ExecutorService getPool(FileProperties fileProperties) {
        pool = init(fileProperties);
        return pool;
    }

    /*
        创建文件处理线程池
     */
    public static ExecutorService init(FileProperties fileProperties) {
        int concurrency = fileProperties.getConcurrency();
        pool = Executors.newFixedThreadPool(concurrency);
        return pool;
    }
}
